<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
	<title>mmNodeApi</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        body {
            font-size: 16px;
            color: #2c3e50;
        }
        header {
            padding: 3rem 0;
            text-align: center;
        }
        h1 {
            font-size: 3rem;
        }
        .desc {
            padding-top: 1.8rem;
            font-size: 1.6rem;
            line-height: 1.3;
            color: #6a8bad;
        }
        main {
            max-width: 520px;
            margin: 0 auto;
        }
        ol {
            width: 300px;
            margin: 0 auto;
            text-align: center;
            line-height: 1.7;
        }
        a,.desc a {
            color: #3eaf7c;
        }
    </style>
</head>
<body>
    <header>
        <h1>mmNodeApi</h1>
        <p class="desc">NodeJS 版 API</p>
    </header>
	<main>
        <ol id="container"></ol>
    </main>
    <script>
        window.onload = () => {
            const data = {
                '热搜': [
                    '/search/hot/qq',
                    '/search/hot/163'
                ],
                '排行榜': [
                    '/toplist/qq',
                    '/toplist/163'
                ],
                '排行榜详情': [
                    '/toplist/detail/qq?id=4',
                    '/toplist/detail/163?id=3778678'
                ],
                '分类歌单': [
                    '/playlist/qq?limit=10&offset=0',
                    '/playlist/163?limit=10&offset=0'
                ],
                '歌单详情': [
                    '/playlist/detail/qq?id=4090560302',
                    '/playlist/detail/163?id=546973478'
                ],
                '歌词': [
                    '/lyric/qq?id=001hUNRP0P8g7x',
                    '/lyric/163?id=169185'
                ]
            }
            const domArr = Object.keys(data).map(item => {
                let q = data[item][0] ? `<a href="${data[item][0]}">QQ</a>` : '',
                n =  data[item][1] ? `&nbsp;/&nbsp;<a href="${data[item][1]}">网易</a>` : ''
                return `<li>${item}：${q}${n}</li>`
            })
            document.querySelector('#container').innerHTML = domArr.join('')
        }
    </script>
</body>
</html>
